<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<base href="<%=basePath%>">




<html>
<head>

    <title>库房分配</title>
    <style type="text/css">
        td {
            font-size: 14px;
            text-align: center;
        }

        input {
            text-align: center;
        }

        table {
            text-align: center;
        }

        #sousuo1 {
            background-image: img/search-icon.png;
            position: relative;
            top: -18px;
            left: -15px
        }

        #xinxi{
            display: none;
            background-color: powderblue;
            position: absolute;
            left:700PX;
            top: 180px;
        }

    </style>
    <link type="text/css" rel="stylesheet" href="css/style.css" />
    <link type="text/css" rel="stylesheet" href="css/index.css" />
    <script src="js/jquery.min.js"></script>
    <!-- 动态菜单JS -->
    <script type="text/javascript" src="js/menu.js"></script>
</head>

<body>

<div class="container">
    <div class="cont-top">
        <div class="companyname">ERP管理系统</div>
        <div class="cont-top-middle">
            <ul>
                <li><h1 STYLE="font-size: 40px;margin-left: 430px; margin-top: 10px">第&nbsp;五&nbsp;人&nbsp;民&nbsp;医&nbsp;院</h1></li>

            </ul>
        </div>
        <div class="cont-top-rg">
            <ul class="advanced-menu">
                <li>
                    <div class="top-search">
                        <div class="t-s-l">
                            <span class="left-line"></span> <input type="text" value="搜库存"
                                                                   class="search-type" disabled> <span
                                class="triangle-bottom"></span>
                        </div>
                        <div class="t-s-l">



                            <form action="BuyServlet?act=sousuo" method="post">
                                <input type="text" placeholder="请输入商品编码或名称" name="sou"
                                       class="search-dt"> <span class="right-line"></span> <span
                                    class="right-icon"> <span class="right-line"> <input
                                    type="submit" value="搜索" id="sousuo1" /></span>
                            </form>





                        </div>
                    </div>
                </li>
                <li class="default" style="position: relative;"><span
                        class="user"><img src="img/user.png"></span> <a
                        class="special"   onclick="denglu()">${user.userName} <i><img
                        src="img/xl.png"></i></a>
                    <div class="drop-down-wrap"
                         style="width: 180px; left: 15px; display: none;">
                        <div class="drop-down">
                            <span class="triangle-border"></span> <span class="triangle-bg"></span>
                            <ul class="del-ul">
                                <li><a href="#" class="hot">首耀照明</a></li>
                                <li><a href="#">小丫头</a></li>
                                <li><a href="#">操作日志</a></li>
                            </ul>
                        </div>
                    </div></li>
            </ul>
            <ul class="advanced-menu">
                <li id="p"  style="display: none;"></li>
                <li><a href="#"><img src="img/top-icon2.png"></a></li>
                <li><a href="#"><img src="img/top-icon3.png"></a></li>
                <li><a href="#"><img src="img/top-icon4.png"></a></li>
                <li><a href="#"><img src="img/top-icon5.png"></a></li>
            </ul>
        </div>
    </div>
    <div class="left-menu" style="height:949px;">
        <div class="menu-list">
            <ul>
                <%--                menuNameOne menuPathList--%>
                <c:forEach var="menuNameOne" items="${menuNameOne}">
                    <li class="menu-list-01">

                        <p class="fumenu">${menuNameOne.menuNameOne}</p>
                        <img class="xiala" src="img/xiala.png"/>

                        <div class="list-p">
                            <c:forEach var="menuPathList" items="${menuPathList}">
                                <c:if test="${menuNameOne.menuNameOne==menuPathList.menuNameOne}">

                                    <a href="${menuPathList.menu.menuPath}" id="href">
                                        <p class="zcd" id="zcd5">${menuPathList.menu.menuNametwo}</p>
                                    </a>
                                </c:if>
                            </c:forEach>
                        </div>
                    </li>
                </c:forEach>
            </ul>


        </div>
    </div>

    <div class="right-menu">
        <hr style="border:  1px solid #0FB9EF">
        <div class="main-hd">

                <div class="l-tab-content" style="background: #fff; ">
                    <div class="tab-content-item" >
                        <div class="home" >
                            <!--库房分配   开始-->
                            <div class="kufang-box" style="height: 120px;margin-top: -10px;">
                                <div class="kufang" style="height: 80px;margin-left: -400px;margin-top: 5px">

                                    <div >
                                        <div class="kf-fl" >
                                            <ul>
                                                <li STYLE="font-size: 15px;margin-left: 800px;margin-top: -12px; ">流水号:<SPAN>${listtingList.get(0).listingSerialNumber}</SPAN></li>

                                            </ul>

                                        </div>
                                        <div class="kf-fl">
                                            <ul>
                                                <li STYLE="font-size: 15px;margin-left: 260px;margin-top: -12px; ">日期:<SPAN id="time"></SPAN></li>

                                            </ul>

                                        </div>
                                    </div>
                                </div>

                                <div class="kf-tab" style="margin-left: 370px;width: 700px;margin-top: -50px;height: 730PX">



                                    <div class="kfbody" tabindex="0"  STYLE="height: 700PX" >
                                        <table border="0" cellpadding="0" cellspacing="1"
                                               class="fkbody-rows" style="width: 100%;">
                                            <tbody>


                                            <td class="caption cao-l">

                                                <div class="caotion-kf-txt"
                                                     style="overflow: hidden; text-align: center;" id="anhao"
                                                     name=${anhao}  >序号</div>
                                            </td>

                                            <td class="caption cao-l">

                                                <div class="caotion-kf-txt"
                                                     style="overflow: hidden; text-align: center;">科室</div>
                                            </td>
                                            <td class="caption cao-l">
                                                <div class="caotion-kf-txt"
                                                     style="overflow: hidden; text-align: center;">检查项目</div>
                                            </td>
                                            <td class="caption cao-l">
                                                <div class="caotion-kf-txt"
                                                     style="overflow: hidden; text-align: center;">价格</div>
                                            </td>


                                            </tr>
                                            </tbody>

                                            <tbody ID="ll">

                                            <c:set var="a" value="1"></c:set>
                                            <c:forEach var="p" items="${listtingList}">
<%--                                                ='${p.listingSerialNumber}'&price='${list.listingPrice}'&cardid='${p.medicalCardNumber}'--%>
                                                <form action="Initialize/settlement?listingSerialNumber" id="tijiao" method="post">

                                                    <tr class="fkbody-s" _rowindex="0">
                                                        <td class="caption-kf" style="overflow: hidden;"
                                                            align="center">
                                                            <div class="caotion-kf-txt1">${a}</div>
                                                        </td>
                                                        <td class="bodyrow-list" _columnindex="0">
                                                            <div class="bodytxt"
                                                                 style="overflow: hidden; text-align: center;">
                                                                <input type="text" id=zichan${a}
                                                                       value="${p.portfolio.portfolioDepartment}" STYLE="background: #f6fcff;width: 100%" />


                                                            </div>
                                                        </td>

                                                        <td class="bodyrow-list" _columnindex="1">
                                                            <div class="bodytxt" id="ming${a}"
                                                                 style="overflow: hidden; text-align: center;">${p.listingProject}</div>
                                                        </td>

                                                        <td class="bodyrow-list" _columnindex="2">
                                                            <div class="bodytxt"
                                                                 style="overflow: hidden; text-align: center;">${p.listingPrice}</div>
                                                        </td>


                                                        <td class="bodyrow-list" _columnindex="4">
                                                            <div class="bodytxt"
                                                                 style="overflow: hidden; text-align: center;"><input type="submit" VALUE="缴费"  disabled></div>
                                                        </td>

                                                    </tr>

                                                </form>
                                                <c:set var="a" value="${a+1}"></c:set>
                                            </c:forEach>
                                            </tbody>

                                        </table>



                                    </div>


                                    <div class="lu">
                                        共<i>${a-1}</i>条记录
                                    </div>

                                </div>
                                <div class="tab-btn">
                                    <div class="bt-f" style="margin-left: 370px">
                                        <ul>
                                                   <li>
                                            <button class="button-li" onclick="settlement()" value="">结算</button>
                                            </li>

                                        </ul>
                                    </div>
                                    <div class="bt-rg" style="margin-right: 600px">
                                        <ul>
                                            <li><a href="sheet/printo" ><button>打印</button> </a></li>
                                            <li><button>退出</button></li>
                                        </ul>
                                    </div>
                                </div>
                                <!--库房分配   结束-->
                                <form action="Initialize/amount?price=${medicalCard.medicalCardBalance}&listingSerialNumber=${listtingList.get(0).listingSerialNumber}" method="post"  id="xinxi" >
                                    <table border="1" cellspacing="0px" cellpadding="0px" style="text-align: center; width: 300; height: 310px;">



                                        <tr><td style="background-color: white;" >余&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;额&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;充&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;值 </td><td><button type="button" onclick="yincang()"  style="float: right; height: 100%; border: 0PX; width: 100%;">X</button></td></tr>
                                        <tr><td colspan="2">卡号</td></tr>
                                        <tr><td colspan="2"><input type="" name="cardid1" id="ming" value="${medicalCard.medicalCardNumber}"  style="width: 100%;height: 100%;"/></td></tr>


                                        <tr><td colspan="2">充值金额</td></tr>
                                        <tr><td colspan="2"><input type="" name="amount" id="ming" value=""  style="width: 100%;height: 100%;"/></td></tr>


                                        <tr><td colspan="2"	><input type="submit" name="" id="" value="是否确认提交"  onclick="queren()"  style="width: 100%;height: 100%;" /></td></tr>


                                    </table>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>


</body>
<script src="js\jquery.min.js"></script>>
<script>

    function  yincang(){

        $("#xinxi").attr("style","display:none")
    }


    <c:if test="${sessionScope.judge=='成功了'}">

    alert("充值成功")
    <% session.removeAttribute("yue");
              session.removeAttribute("judge");%>
    </c:if>

    <c:if test="${sessionScope.judge=='成功'}">

    alert("缴费成功")
    <% session.removeAttribute("yue");
              session.removeAttribute("judge");%>
    </c:if>

    <c:if test="${sessionScope.judge=='失败了'}">
    alert("充值失败")


    <% session.removeAttribute("yue");
          session.removeAttribute("judge");%>
    </c:if>


    <c:if test="${sessionScope.yue=='余额不足'}">

    var bl=confirm("您的当前余额为'${medicalCard.medicalCardBalance}',缴纳金额不足,是否充值")
    if(bl==true){

        $("#xinxi").attr("style","display:block")
        <% session.removeAttribute("yue");
          session.removeAttribute("judge");%>
    }


</c:if>




     function settlement(){
        var price= $("#ll").children().last().children().eq(3).children().html()

         window.location.href="Initialize/settlement?listingSerialNumber=${listtingList.get(0).listingSerialNumber}&cardid=${listtingList.get(0).medicalCardNumber}&price="+price;
  }




    var date = new Date();
    var month = date.getMonth() + 1;
    var strDate = date.getDate();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentDate = date.getFullYear() + "-" + month + "-" + strDate
        + " " + date.getHours() + ":" + date.getMinutes() ;

    $("#time").html(currentDate)
</script>

</html>
